Optimal. Leaf size=127 \[ -\frac {2 a^2 (a \sin (e+f x)+a)^{m-2} (c-c \sin (e+f x))^n (g \cos (e+f x))^{4-2 m}}{f g (-m+n+2) (-m+n+3)}-\frac {a (a \sin (e+f x)+a)^{m-1} (c-c \sin (e+f x))^n (g \cos (e+f x))^{4-2 m}}{f g (-m+n+3)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.41, antiderivative size = 127, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 40, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.050, Rules used = {2846, 2844} \[ -\frac {2 a^2 (a \sin (e+f x)+a)^{m-2} (c-c \sin (e+f x))^n (g \cos (e+f x))^{4-2 m}}{f g (-m+n+2) (-m+n+3)}-\frac {a (a \sin (e+f x)+a)^{m-1} (c-c \sin (e+f x))^n (g \cos (e+f x))^{4-2 m}}{f g (-m+n+3)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2844
Rule 2846
Rubi steps
\begin {align*} \int (g \cos (e+f x))^{3-2 m} (a+a \sin (e+f x))^m (c-c \sin (e+f x))^n \, dx &=-\frac {a (g \cos (e+f x))^{4-2 m} (a+a \sin (e+f x))^{-1+m} (c-c \sin (e+f x))^n}{f g (3-m+n)}+\frac {(2 a) \int (g \cos (e+f x))^{3-2 m} (a+a \sin (e+f x))^{-1+m} (c-c \sin (e+f x))^n \, dx}{3-m+n}\\ &=-\frac {2 a^2 (g \cos (e+f x))^{4-2 m} (a+a \sin (e+f x))^{-2+m} (c-c \sin (e+f x))^n}{f g (2-m+n) (3-m+n)}-\frac {a (g \cos (e+f x))^{4-2 m} (a+a \sin (e+f x))^{-1+m} (c-c \sin (e+f x))^n}{f g (3-m+n)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 1.38, size = 143, normalized size = 1.13 \[ -\frac {g^3 \cos ^{2 n}(e+f x) \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right )^4 (g \cos (e+f x))^{-2 m} ((-m+n+2) \sin (e+f x)-m+n+4) (a (\sin (e+f x)+1))^{m-n} \exp (n (\log (a (\sin (e+f x)+1))+\log (c-c \sin (e+f x))-2 \log (\cos (e+f x))))}{f (-m+n+2) (-m+n+3)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.52, size = 298, normalized size = 2.35 \[ \frac {{\left ({\left (m - n - 2\right )} \cos \left (f x + e\right )^{2} + {\left (m - n - 4\right )} \cos \left (f x + e\right ) + {\left ({\left (m - n - 2\right )} \cos \left (f x + e\right ) + 2\right )} \sin \left (f x + e\right ) - 2\right )} \left (g \cos \left (f x + e\right )\right )^{-2 \, m + 3} {\left (a \sin \left (f x + e\right ) + a\right )}^{m} e^{\left (2 \, n \log \left (g \cos \left (f x + e\right )\right ) - n \log \left (a \sin \left (f x + e\right ) + a\right ) + n \log \left (\frac {a c}{g^{2}}\right )\right )}}{2 \, f m^{2} + 2 \, f n^{2} - {\left (f m^{2} + f n^{2} - 5 \, f m - {\left (2 \, f m - 5 \, f\right )} n + 6 \, f\right )} \cos \left (f x + e\right )^{2} - 10 \, f m - 2 \, {\left (2 \, f m - 5 \, f\right )} n + {\left (f m^{2} + f n^{2} - 5 \, f m - {\left (2 \, f m - 5 \, f\right )} n + 6 \, f\right )} \cos \left (f x + e\right ) + {\left (2 \, f m^{2} + 2 \, f n^{2} - 10 \, f m - 2 \, {\left (2 \, f m - 5 \, f\right )} n + {\left (f m^{2} + f n^{2} - 5 \, f m - {\left (2 \, f m - 5 \, f\right )} n + 6 \, f\right )} \cos \left (f x + e\right ) + 12 \, f\right )} \sin \left (f x + e\right ) + 12 \, f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [F] time = 26.10, size = 0, normalized size = 0.00 \[ \int \left (g \cos \left (f x +e \right )\right )^{3-2 m} \left (a +a \sin \left (f x +e \right )\right )^{m} \left (c -c \sin \left (f x +e \right )\right )^{n}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 2.80, size = 485, normalized size = 3.82 \[ \frac {{\left (a^{m} c^{n} g^{3} {\left (m - n - 4\right )} - \frac {2 \, a^{m} c^{n} g^{3} {\left (m - n - 6\right )} \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} - \frac {a^{m} c^{n} g^{3} {\left (m - n + 12\right )} \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac {4 \, a^{m} c^{n} g^{3} {\left (m - n + 2\right )} \sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}} - \frac {a^{m} c^{n} g^{3} {\left (m - n + 12\right )} \sin \left (f x + e\right )^{4}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{4}} - \frac {2 \, a^{m} c^{n} g^{3} {\left (m - n - 6\right )} \sin \left (f x + e\right )^{5}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{5}} + \frac {a^{m} c^{n} g^{3} {\left (m - n - 4\right )} \sin \left (f x + e\right )^{6}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{6}}\right )} e^{\left (2 \, n \log \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} - 1\right ) - 2 \, m \log \left (-\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + 1\right ) + m \log \left (\frac {\sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + 1\right ) - n \log \left (\frac {\sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + 1\right )\right )}}{{\left ({\left (m^{2} - m {\left (2 \, n + 5\right )} + n^{2} + 5 \, n + 6\right )} g^{2 \, m} + \frac {3 \, {\left (m^{2} - m {\left (2 \, n + 5\right )} + n^{2} + 5 \, n + 6\right )} g^{2 \, m} \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac {3 \, {\left (m^{2} - m {\left (2 \, n + 5\right )} + n^{2} + 5 \, n + 6\right )} g^{2 \, m} \sin \left (f x + e\right )^{4}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{4}} + \frac {{\left (m^{2} - m {\left (2 \, n + 5\right )} + n^{2} + 5 \, n + 6\right )} g^{2 \, m} \sin \left (f x + e\right )^{6}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{6}}\right )} f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 18.13, size = 476, normalized size = 3.75 \[ -\frac {{\left (c-c\,\sin \left (e+f\,x\right )\right )}^n\,\left (\frac {{\left (g\,\cos \left (e+f\,x\right )\right )}^{3-2\,m}\,{\left (a+a\,\sin \left (e+f\,x\right )\right )}^m\,\left (n-m+2\right )}{f\,\left (m^2-2\,m\,n-5\,m+n^2+5\,n+6\right )}-\frac {{\left (g\,\cos \left (e+f\,x\right )\right )}^{3-2\,m}\,\left (\cos \left (3\,e+3\,f\,x\right )+\sin \left (3\,e+3\,f\,x\right )\,1{}\mathrm {i}\right )\,{\left (a+a\,\sin \left (e+f\,x\right )\right )}^m\,\left (-m\,1{}\mathrm {i}+n\,1{}\mathrm {i}+2{}\mathrm {i}\right )}{f\,\left (m^2-2\,m\,n-5\,m+n^2+5\,n+6\right )}-\frac {{\left (g\,\cos \left (e+f\,x\right )\right )}^{3-2\,m}\,\left (\cos \left (e+f\,x\right )+\sin \left (e+f\,x\right )\,1{}\mathrm {i}\right )\,{\left (a+a\,\sin \left (e+f\,x\right )\right )}^m\,\left (-m\,1{}\mathrm {i}+n\,1{}\mathrm {i}+6{}\mathrm {i}\right )}{f\,\left (m^2-2\,m\,n-5\,m+n^2+5\,n+6\right )}+\frac {{\left (g\,\cos \left (e+f\,x\right )\right )}^{3-2\,m}\,\left (\cos \left (2\,e+2\,f\,x\right )+\sin \left (2\,e+2\,f\,x\right )\,1{}\mathrm {i}\right )\,{\left (a+a\,\sin \left (e+f\,x\right )\right )}^m\,\left (n-m+6\right )}{f\,\left (m^2-2\,m\,n-5\,m+n^2+5\,n+6\right )}\right )}{3\,\cos \left (e+f\,x\right )+\sin \left (e+f\,x\right )\,3{}\mathrm {i}-\cos \left (3\,e+3\,f\,x\right )-\sin \left (3\,e+3\,f\,x\right )\,1{}\mathrm {i}+\frac {m^2\,1{}\mathrm {i}-m\,n\,2{}\mathrm {i}-m\,5{}\mathrm {i}+n^2\,1{}\mathrm {i}+n\,5{}\mathrm {i}+6{}\mathrm {i}}{m^2-2\,m\,n-5\,m+n^2+5\,n+6}-\frac {3\,\left (\cos \left (2\,e+2\,f\,x\right )+\sin \left (2\,e+2\,f\,x\right )\,1{}\mathrm {i}\right )\,\left (m^2\,1{}\mathrm {i}-m\,n\,2{}\mathrm {i}-m\,5{}\mathrm {i}+n^2\,1{}\mathrm {i}+n\,5{}\mathrm {i}+6{}\mathrm {i}\right )}{m^2-2\,m\,n-5\,m+n^2+5\,n+6}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________